package cn.edu.scau.cmi.chenjia.client;

import java.util.Scanner;

import cn.edu.scau.cmi.chenjia.simpleFactoryMethod.Meat;
import cn.edu.scau.cmi.chenjia.simpleFactoryMethod.Beef;
import cn.edu.scau.cmi.chenjia.simpleFactoryMethod.Pork;
import cn.edu.scau.cmi.chenjia.simpleFactoryMethod.Chicken;
import cn.edu.scau.cmi.chenjia.factory.MeatFactory;

public class FactoryClient {
		public static void main(String args[]) {
			System.out.println("Please enter factory mode:");
			for(int i=0;;i++) {
			Scanner in = new Scanner(System.in);
			String model=in.nextLine();
			Meat meat=null;
			switch(model) {
			case "beefMeatFactory":
				meat = new Beef();
				break;
			case "porkMeatFactory":
				meat = new Pork();
				break;
			case "chickenMeatFactory":
				meat=new Chicken();
				break;
			default:
				break;
			}
			if(meat!=null)
				meat.cook();
			else
				System.out.println("Input error!");
			}
		}
}